#ifndef CDIALOG_H_
#define CDIALOG_H_

#include "cguiobject.h"

// Forward declarations
class CGuiManager;
struct TLesserZ;
struct TGreaterZ;

/**
 * CDialog - class representing dialog for placing gui components
 * @author Michal Rost
 * @date 30.03.2008
 */
class CDialog : public CGuiObject {
  friend class CGuiManager;
  friend struct TLesserZ;
  friend struct TGreaterZ;
public:
  CDialog();
  CDialog(const CLayout &layout, int x = 0, int y = 0);
  void setX(int x);
  void setY(int y);
  void addItem(CGuiObject* itemPtr, TIndex posX, TIndex posY,
      TIndex spanX = 1, TIndex spanY = 1);
  bool isOverlap(CRect<int> &rect);
  static string getClassName() {
    return "CDialog";
  }
protected:
  int z;
  static int maxZLevel;
  int getZ() const;
  void setZ(int z);
  void drawSelf(CGuiRenderer* rendererPtr);
  bool isFocused(CMouseEvent* eventPtr);
  void onAdd() {
  }
};

#endif
